package com.example.springbootv1.controller;

import com.example.springbootv1.service.StatisticsService;
import com.example.springbootv1.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@CrossOrigin(origins = "*")
@RequestMapping("statistics")
public class StatisticsController {
    @Autowired
    private StatisticsService statisticsService;

    @GetMapping("/getSexStatistics")
    public Result getSexStatistics() {
        return Result.success(statisticsService.getSexStatistics());
    }

    @GetMapping("/getGradeStatistics")
    public Result getGradeStatistics() {
        return Result.success(statisticsService.getGradeStatistics());
    }
    @GetMapping("/getBillsStatistics")
    public Result getBillsStatistics() {
        return Result.success(statisticsService.getBillsStatistics());
    }
}
